package com.bw.ads;

public class Test {

    /**
     * 累加递增统计每日总订单数、总销售额和总商品数量，必须使用开窗函数，否则不得分
     *  select
     *     sum(order_ct) over( partition by cur_date),
     *     sum(order_amount) over(partition by cur_date),
     *     sum(order_sku_num) over(partition by cur_date)
     * from yk1;
     *
     *
     *
     *
     *
     *获取各个省份销售量最好的Top5商品，按照订单数比较
     * select
     *     sku_id,
     *     province_name
     * from (
     *       select
     *           rank() over(partition by province_name order by ct desc) rk,
     *           province_name,
     *           sku_id
     *       from (
     *                select
     *                    province_name,
     *                    sku_id,
     *                    sum(order_ct) ct
     *                from yk1 group by province_name,sku_id
     *                )t1
     * )t2 where rk <= 5;
     */
}
